public class Problem2 {
	public static void main(String[] args) {
		int m = 1;
		int n = 2;
		int s = m+n;
		int sum = n;
		while(s < 4000000) {
			if((s&1) == 0) {
				sum += s;
			}
			m = n;
			n = s;
			s = m+n;
		}

		System.out.println(""+sum);
	}
}
